<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>账号编辑</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<script src="__STATIC__/admin/js/address3.js"></script>
	<style>
		.layui-input-block{margin-left:160px!important}
		</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
			 <div class="layui-card-header">
				{if !$info['id']}<i class="fa fa-plus"></i> 新增账号{else}<i class="fa fa-pencil"></i> 编辑账号{/if}
			 <i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i></div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6" lay-filter="">
						<input type="hidden" name="info[id]" value="{$info['id']}"/>
						<!-- <div class="layui-form-item">
							<label class="layui-form-label">头像</label>
							<input type="hidden" name="info[headimg]" id="headimg" class="layui-input" value="{$info['headimg']}">
							<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="headimg" upload-preview="headimgPreview" onclick="uploader(this)">上传图片</button>
							<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：150×150像素</div>
							<div id="headimgPreview" style="float:left;padding-top:10px;margin-left:110px;clear: both;">
								<div class="layui-imgbox" style="width:100px;"><div class="layui-imgbox-img"><img src="{$info['headimg']}"/></div></div>
							</div>
						</div> -->
						<div class="layui-form-item">
							<label class="layui-form-label">登录账号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[un]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info.un}">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">登录密码：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[pwd]" class="layui-input" autocomplete="off" value="" {if $info['id']} placeholder="留空表示不修改密码"{else} lay-verify="required" lay-verType="tips"{/if}>
							</div>
						</div>
						<div class="layui-form-item" style="{if $bid!=0}display:none{/if}">
							<label class="layui-form-label">{:t('会员')}ID：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[mid]" class="layui-input" value="{$info.mid}">
							</div>
							<div class="layui-form-mid layui-word-aux">用于绑定会员接收消息通知{if $bid==0}<a href="javascript:vodi(0)" onclick="openmax('{:url('Member/index')}/isopen/1')">查找{:t('会员')}ID</a>{/if}</div>
						</div>
						{if getcustom('admin_login_sms_verify') || getcustom('sms_temp_orderpay_adminuser')}
						<div class="layui-form-item">
							<label class="layui-form-label">手机号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[tel]" class="layui-input" value="{$info.tel}">
							</div>
							<div class="layui-form-mid layui-word-aux"></div>
						</div>
						{/if}
						
						
						<div class="layui-form-item">
							<label class="layui-form-label">备注：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[remark]" class="layui-input" value="{$info['remark']}">
							</div>
						</div>
						
						{if $thisuser_isadmin!=0 && $info['id'] && $info['id']!=$thisuserid}
						<div class="layui-form-item">
							<label class="layui-form-label">创建人：</label>
							<div class="layui-input-inline">
								<select name="info[addid]">
									{foreach $userlist as $u}
									<option value="{$u.id}" {if $u['id'] == $info['addid']}selected{/if}>{$u.un}</option>
									{/foreach}
								</select>
							</div>
						</div>
						{/if}

						{if (!$info['id'] || $info['isadmin']==0 || $info['isadmin']==3) && $info['id']!=$thisuserid}
						<div class="layui-form-item">
							<label class="layui-form-label">权限组：</label>
							<div class="layui-input-inline">
								<select name="info[groupid]" lay-filter="groupidChange">
									{foreach $groupList as $group}
									<option value="{$group.id}" {if $info['groupid']==$group['id']}selected{/if}>{$group.name}</option>
									{/foreach}
								</select>
							</div>
						</div>

						
						
						<div id="quanxianset_div" style="{if $info['groupid']!=0}display:none{/if}">
							{if $thisuser_mdid == 0}
							<div class="layui-form-item">
								<label class="layui-form-label">门店：</label>
								<div class="layui-input-inline" style="width:800px">
									<input type="radio" name="info[mdid]" value="0" {if !$info['id'] || $info['mdid']==0}checked{/if} title="全部">
									{foreach $mendianlist as $md}<input type="radio" name="info[mdid]" value="{$md.id}" {if $md['id']==$info['mdid']}checked{/if} title="{$md.name}">{/foreach}
								</div>
								<div class="layui-word-aux layui-clear">指定门店后，该管理员的订单权限只能看到指定门店的订单</div>
							</div>
							{elseif !$info['id']}
							<input type="hidden" value="info[mdid]" value="{$thisuser_mdid}"/>
							{/if}

							
							{if (!getcustom('user_bquanxian') || $bid != 0) && !$info['id']}
							<input type="hidden" value="bids[]" value="0"/>
							{/if}
							
							{if $thisuser_showtj == 1}
							<div class="layui-form-item">
								<label class="layui-form-label">首页数据统计：</label>
								<div class="layui-input-inline">
									<input type="radio" name="info[showtj]" value="1" {if $info['showtj']==1}checked{/if} title="显示"/>
									<input type="radio" name="info[showtj]" value="0" {if $info['showtj']==0}checked{/if} title="不显示"/>
								</div>
							</div>
							{elseif !$info['id']}
							<input type="hidden" value="info[showtj]" value="0"/>
							{/if}
							

							{if getcustom('kecheng_lecturer')}
								{if $haslecturer}
								<div class="layui-form-item">
									<label class="layui-form-label">课程讲师：</label>
									<div class="layui-input-inline">
										<select name="info[lecturerid]">
											<option {if !$info['id'] || $info['lecturerid']==0}selected{/if} value="0" >请选择</option>
											{foreach $lecturers as $lecturer}
											<option {if $info['lecturerid']==$lecturer['id']}selected{/if} value="{$lecturer.id}" >{$lecturer.nickname} {$lecturer.tel}</option>
											{/foreach}
										</select>
									</div>
								</div>
								{/if}
							{/if}

							{include file="public/user_auth"/}
						</div>
						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-inline">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
  
	{include file="public/js"/}
	<script>
	layui.form.on('checkbox(checkall_all)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox');
	})
	layui.form.on('checkbox(checkall)',function(data){
		if(data.elem.checked){
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',true);
		}else{
			$(data.elem).parent().parent().find('input[type=checkbox]').prop('checked',false);
		}
		layui.form.render('checkbox');
	})
	layui.form.on('select(groupidChange)',function(data){
		if(data.value == 0){
			$('#quanxianset_div').show();
		}else{
			$('#quanxianset_div').hide();
		}
	});
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		var index = layer.load();
		$.post("{:url('save')}",obj.field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				setTimeout(function(){
					parent.layer.closeAll();
					parent.tableIns.reload()
				},1000)
			}
		})
	})

	//这里写在定制里面
	
	//这里写在定制里面
	

		
  </script>
	{include file="public/copyright"/}
</body>
</html>